package watercups.states;

import java.util.ArrayList;
import templates.State;


public class WaterCupState {
	protected int capacity1;//volum maxim apa cana 1
	protected int capacity2;//volum maxim apa cana 2
	
	public WaterCupState() {
		super();
		this.capacity1 = 0;
		this.capacity2 = 0;
	}
	
	public WaterCupState(int capacity1, int capacity2) {
		super();
		this.capacity1 = capacity1;
		this.capacity2 = capacity2;
	}

	public int getCapacity1() {
		return capacity1;
	}

	public void setCapacity1(int capacity1) {
		this.capacity1 = capacity1;
	}

	public int getCapacity2() {
		return capacity2;
	}

	public void setCapacity2(int capacity2) {
		this.capacity2 = capacity2;
	}
	
	@Override
	public String toString() {
		return "Capacitate 1: "+capacity1+"Capacitate 2:"+capacity2;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + capacity1;
		result = prime * result + capacity2;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		WaterCupState other = (WaterCupState) obj;
		if (capacity1 != other.capacity1)
			return false;
		if (capacity2 != other.capacity2)
			return false;
		return true;
	}
	public static ArrayList <State<WaterCupState>> finalState(){
		
		ArrayList<State<WaterCupState>> fStates =new ArrayList<State<WaterCupState>>();
		fStates.add(new State<WaterCupState>(new WaterCupState(0,2),null));
		fStates.add(new State<WaterCupState>(new WaterCupState(1,2),null));
		fStates.add(new State<WaterCupState>(new WaterCupState(2,2),null));
		fStates.add(new State<WaterCupState>(new WaterCupState(3,2),null));
		return fStates;
	}
	
	public static State<WaterCupState> initialState(){
		return new State<WaterCupState>(new WaterCupState(), new InitialState());
	}
	
}
